package Practice10;

public class InstanceofTest {
    public static void main(String[] args) {
        Animal a  =new Cat();
        a.eat();
        if(a  instanceof Cat){
            Cat c = (Cat) a;
            c.catchMouse();
        }else if(a instanceof  Dot){
            Dot d = (Dot) a;
            d.eat();
        }
    }
}
